<template>
  <div>
    <!-- 头部部分 -->
    <header class="header">
      <h1>todos</h1>
      <input v-model.trim="name" @keyup.enter="submit" class="new-todo" placeholder="请输入任务名称" autofocus />
    </header>
  </div>
</template>

<script>
export default {
  data () {
    return {
      name:''
    }
  },

  created () {

  },
  computed:{
    
  },
  methods: {
    submit(){
      this.$emit('add',this.name)
      this.name=''
    },
  }
}
</script>

<style scoped lang='scss'>

</style>
